<template>
  <div>
   <div>
    <van-nav-bar
  title="收藏列表"
  left-arrow

      @click-left="$router.back()"

/>
   </div>

<div>

  <van-list
  v-model="loading"
  :finished="finished"
  finished-text="没有更多了"
  @load="onLoad"
>

<ArticleItem v-for="item in list"
:key="item.id"
:item="item"
></ArticleItem>
</van-list>
</div>
  </div>
</template>

<script>
import { collect } from '@/api/user.js'
import { getToken } from '@/utils/storage'
import ArticleItem from '@/components/ArticleItem.vue'
export default {
  components: {
    ArticleItem
  },
  name: 'collect-page',

  data () {
    return {
      list: [],
      loading: false,
      finished: false,
      page: 1
    }
  },
  methods: {
    async onLoad () {
      // const { body } = await collect({ page: this.page })
      // console.log(res)
      const token = getToken()
      const res = await collect(token)
      console.log(res)
      // this.list.push(...body.rows)
      // this.loading = false
      // this.page++
      // if (this.page > body.pageTotal) {
      //   this.finished = true
    }
    // console.log(rows)
  }

}
</script>

<style>

</style>
